#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

int main()
{
    close(1);
    FILE* fd=fopen("myfile","w");
    if(fd==NULL)
    {
        perror("open");
        return 1;
    }
     printf("this is myfile\n");
    // fflush(stdout);
     fclose (stdout);
     return 0;

}
